
<template>
    <div id="competitiveInformation">
        <div class="volunteer" align="left" style="margin-top:60px">
            <template>
                <Button type="warning" style="margin-right:30px;width: 100px" @click='intelligence_student_onclick'>招生计划情报</Button>
                <Button type="primary" style="margin-right:30px;width: 100px" @click='intelligence_opponent_onclick'>功能使用情报</Button>
                <Button type="warning" style="margin-right:30px;width: 100px" @click='intelligence_grade_onclick'>分数情报</Button>
                <Button type="warning" style="margin-right:30px;width: 100px" @click='intelligence_ranking_onclick'>排名情报</Button>
            </template>
        </div>
        <div class="volunteer" align="left" style="margin-top:30px">
            <template>
                <Icon type="plus-circled" style="color: #ee9900;font-size: 18px;">
                </Icon>
                <span style="font-size:17px">第一批次
          			</span>
            </template>
        </div>

        <hr style='margin-top:10px'>
        <div class="operation" style='margin-top:30px'>
            <template>
                <Table border :columns="columns7" :data="data6"></Table>
            </template>
        </div>
        <div class="volunteer-2" align="left" style="margin-top:30px">
            <template>
                <Icon type="plus-circled" style="color: #ee9900;font-size: 18px;">
                </Icon>
                <span style="font-size:17px">第二批次
          			</span>
            </template>
        </div>
        <hr style='margin-top:10px'>
        <div class="operation" style='margin-top:30px'>
            <template>
                <Table border :columns="columns8" :data="data8"></Table>
            </template>
        </div>
        <div class="volunteer-3" align="left" style="margin-top:30px">
            <template>
                <Icon type="plus-circled" style="color: #ee9900;font-size: 18px;">
                </Icon>
                <span style="font-size:17px">第三批次
          			</span>
            </template>
        </div>
        <hr style='margin-top:10px'>
        <div class="operation" style='margin-top:30px'>
            <template>
                <Table border :columns="columns3" :data="data3"></Table>
            </template>
        </div>
        <div class="volunteer-4" align="left" style="margin-top:30px">
            <template>
                <Icon type="plus-circled" style="color: #ee9900;font-size: 18px;">
                </Icon>
                <span style="font-size:17px">专科/高职
          			</span>
            </template>
        </div>
        <hr style='margin-top:10px'>
        <div class="volunteer-4" style='margin-top:30px'>
            <template>
                <Table border :columns="columns4" :data="data4"></Table>
            </template>
        </div>


        <template>
            <Modal   title="对手情报分析"
                     v-model="modal1"
                     @on-ok="ok"
                     @on-cancel="cancel">
                <Table :columns="columns1" :data="data1"></Table>
            </Modal>
        </template>
    </div>
    </div>
</template>
<script>
    import {exam} from "../../../../api/index.js"
    export default {
        data () {
            return {
                batch1:"01",
                batch2:"02",
                batch3:"03",
                batch4:"04",
                modal1: false,
                columns7: [
                    {
                        title: '院校名称',
                        key: 'martich_school_name'

                    },
                    {
                        title: '专业名称',
                        key: 'view_zy_name'

                    },
                    {
                        title: '浏览过人数',
                        key: 'll_num'

                    },
                    {
                        title: '收藏过人数',
                        key: 'sc_num'

                    },
                    {
                        title: '操作',
                        key: 'action',
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'warning',
                                        icon: 'ios-search-strong',
                                        shape: 'circle'
                                    },
                                    on: {
                                        click: () => {
                                            this.modal1 = true,
                                            this.Opponent();
                                        }
                                    }
                                })
                            ]);
                        }
                    }
                ],
                data6: [
                ],
                columns8: [
                    {
                        title: '院校名称',
                        key: 'martich_school_name'

                    },
                    {
                        title: '专业名称',
                        key: 'view_zy_name'

                    },
                    {
                        title: '浏览过人数',
                        key: 'll_num'

                    },
                    {
                        title: '收藏过人数',
                        key: 'sc_num'

                    },
                    {
                        title: '操作',
                        key: 'action',
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'warning',
                                        icon: 'ios-search-strong',
                                        shape: 'circle'
                                    },
                                    on: {
                                        click: () => {
                                        this.modal1 = true;
                                        }
                                    }
                                }),
                            ]);
                        }
                    }
                ],
                data8: [
                ], columns3: [
                    {
                        title: '院校名称',
                        key: 'martich_school_name'

                    },
                    {
                        title: '专业名称',
                        key: 'view_zy_name'

                    },
                    {
                        title: '浏览过人数',
                        key: 'll_num'

                    },
                    {
                        title: '收藏过人数',
                        key: 'sc_num'

                    },
                    {
                        title: '操作',
                        key: 'action',
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'warning',
                                        icon: 'ios-search-strong',
                                        shape: 'circle'
                                    },
                                    on: {
                                        click: () => {
                                        this.modal1 = true;
                                        }
                                    }
                                }),
                            ]);
                        }
                    }
                ],
                data3: [
                ],
                columns4: [
                {
                        title: '院校名称',
                        key: 'martich_school_name'

                    },
                    {
                        title: '专业名称',
                        key: 'view_zy_name'

                    },
                    {
                        title: '浏览过人数',
                        key: 'll_num'

                    },
                    {
                        title: '收藏过人数',
                        key: 'sc_num'

                    },

                    {
                        title: '操作',
                        key: 'action',
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'warning',
                                        icon: 'ios-search-strong',
                                        shape: 'circle'
                                    },
                                    on: {
                                        click: () => {
                                        this.modal1 = true;
                                        }
                                    }
                                }),
                            ]);
                        }
                    }
                ],
                data4: [

                ],
                columns1: [
                    {
                        title: '地区',
                        key: 'areaName'
                    },
                    {
                        title: '学校',
                        key: 'schoolName'
                    },
                    {
                        title: '班级',
                        key: 'grade'
                    },
                    {
                        title: '总分',
                        key: 'sum'
                    }
                ],
                data1: [

                ]
            }
        },
        methods: {
            intelligence_ranking_onclick: function () {
                this.$router.push({
                    name: 'intelligence_ranking'
                });
            },intelligence_grade_onclick: function () {
                this.$router.push({
                    name: 'intelligence_grade'
                });
            },intelligence_opponent_onclick: function () {
                this.$router.push({
                    name: 'competitive_information'
                });
            },intelligence_student_onclick: function () {
                this.$router.push({
                    name: 'intelligence_student'
                });
            },firstLoad(){
                var _this = this;
                //查询第一志愿信息
                exam.findAll_intelligence({data:{batchId:this.batch1}}).then((data) => {
                    for(var i in data.data.data.collectinfo){
                    _this.data6.push(data.data.data.collectinfo[i]) ;
                }
                if(data.data.data.resCode = "0"){
                    this.secondLoad();
                }
            }, function (error) {
                    console.log(error);
                });
            },secondLoad(){
                var _this = this;
                //查询第二志愿信息
                exam.findAll_intelligence({data:{batchId:this.batch2}}).then((data) => {
                    for(var i in data.data.data.collectinfo){
                    _this.data8.push(data.data.data.collectinfo[i]) ;
                }
                if(data.data.data.resCode = "0"){
                    this.thirdLoad();
                }
            }, function (error) {
                    console.log(error);
                });
            },thirdLoad(){
                //查询第三志愿信息
                var _this = this;
                exam.findAll_intelligence({data:{batchId:this.batch3}}).then((res) => {
                    for(var i in res.data.data.collectinfo){
                    _this.data3.push(res.data.data.collectinfo[i]) ;
                }if(res.data.data.resCode = "0"){
                    this.fouthLoad();
                }
            }, function (error) {
                    console.log(error);
                });
            },fouthLoad(){
                //查询第四志愿信息
                var _this = this;
                exam.findAll_intelligence({data:{batchId:this.batch4}}).then((res) => {
                    for(var i in res.data.data.collectinfo){
                    _this.data4.push(res.data.data.collectinfo[i]);
                }
            }, function (error) {
                    console.log(error);
                });
            },Opponent(){
                var _this = this;
                _this.data1=[]
                exam.findAll_intelligenceOpponent().then((res) => {
                    for(var i in res.data.data.intelligenceOpponent){
                    _this.data1.push(res.data.data.collectinfo[i]);
                }
            }, function (error) {
                    console.log(error);
                })
            }
        },mounted() {
            this.firstLoad();
        }
    };
</script>

